package com.sean.order.controller;

import com.sean.order.entity.Order;
import com.sean.order.service.IOrderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/order")
public class OrderController {
    @Resource
    private IOrderService orderService;

    @GetMapping("/add")
    public String add(){
        Order order = new Order();
        order.setProductId(9L);
        order.setTotalAmount(100.0);
        order.setStatus(0);
        orderService.add(order);
        return "true";
    }
}
